﻿using System.Collections.Generic;
using Newtonsoft.Json;

namespace T.FAS.Runtime.Metadata.Entity.MF
{
    // 结束节点
    public class EndNode : NodeBase
    {
        [JsonProperty("data")]
        public new EndNodeData Data { get; set; }
    }


    public class EndNodeData
    {
        [JsonProperty("label")]
        public string Label { get; set; }

        [JsonProperty("description")]
        public string Description { get; set; }

        [JsonProperty("outputFields")]
        public List<EndUserVariable> OutputVariables { get; set; }

        // 其他结束节点特定属性
        [JsonProperty("conditionOperator")]
        public string ConditionOperator { get; set; }
        [JsonProperty("conditionValue")]
        public string ConditionValue { get; set; }
        [JsonProperty("conditionVariable")]
        public string ConditionVariable { get; set; }
        [JsonProperty("enableConditionalEnd")]
        public bool EnableConditionalEnd { get; set; }
        [JsonProperty("endType")]
        public string EndType { get; set; }
        [JsonProperty("includeMetadata")]
        public bool IncludeMetadata { get; set; }
        [JsonProperty("message")]
        public string Message { get; set; }
        [JsonProperty("metadataFields")]
        public string MetadataFields { get; set; }
        [JsonProperty("outputFormat")]
        public string OutputFormat { get; set; }
        [JsonProperty("status")]
        public string Status { get; set; }
    }
    public class EndUserVariable
    {
        [JsonProperty("id")]
        public string ID { get; set; }

        [JsonProperty("label")]
        public string Label { get; set; }
        [JsonProperty("type")]
        public string Type { get; set; }

        [JsonProperty("variable")]
        public string Variable{ get; set; }
      
        /// <summary>
        /// 标识是常量还是变量
        /// </summary>
        [JsonProperty("valueType")]
        public string ValueType { get; set; }

        [JsonProperty("variableNodeId")]
        public string VariableNodeID { get; set; }
        [JsonProperty("variableValue")]
        public string VariableValue {get;set;}

        [JsonProperty("variableType")]
        public string VariableType { get; set; }
        [JsonProperty("variableId")]
        public string VariableId { get; set; }
    }
}
